/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;

/**
 * <p>Project: jse2303 - Ex9
 * <p>Powered by webrx On 2023-07-24 11:27:43
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex9 {
    public static void main(String[] args) {
        String f = "FileUtil.txt";
        try (
                BufferedReader br = new BufferedReader(new FileReader(f));
                BufferedWriter out = new BufferedWriter(new FileWriter("FileUtil2.txt"))

        ) {

            while (br.ready()) {
                out.write((br.readLine().replaceAll("\\d+、", "")) + "\r\n");
            }

        } catch (Exception e) {
            e.printStackTrace();
        }


        //String f = "D:\\0703\\javase\\jse2303\\jse2303\\ch09\\src\\cn\\webrx\\FileUtil.java";
        //try (BufferedReader br = new BufferedReader(new FileReader(f)); BufferedWriter out = new BufferedWriter(new FileWriter("FileUtil.txt"))) {
        //    int rows = 0;
        //    while (br.ready()) {
        //        out.write(++rows + "、" + br.readLine() + "\r\n");
        //    }
        //
        //} catch (Exception e) {
        //    e.printStackTrace();
        //}
    }
}
